package recordsDatabase;


import java.io.Serializable;
import java.util.ArrayList;


public class Person implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 4760824264357899814L;
	// create the list
	private ArrayList<Record> list;

	public Person() {
		// initialize the list
		list = new ArrayList<Record>();
	}

	public void addElement(Record record) {
		list.add(record);
	}

	
	public Record getRecord(String value) {
	   Record record = null;
	       for (Record r:list){
	           if (r.getRecordName().equals(value)){return r;}
	       }
	       return record;      
	}
	
	public int getLength(){
		return list.size();
	}
	
	public ArrayList<Record> getRecordsList(){
		return list;
	}

}
